<?php
namespace Game\Lib;
class Redis_Const
{

    /*****************************
    参数
     *****************************/
    const SUCCESS                       = 0;        //操作成功
    const FAILED                        = -1;       //操作失败
    const Key_Nonexistent               = -1;
    const Key_Exists                    = true;
    const Member_Nonexistent            = false;
    const Member_Exists                 = true;
    const DATA_NONEXISTENT              = false;        //数据不存在


    /** @var string Room hash */
    const Room_Key                      = "Room:[roomid]";
    const Room_Field_Number             = "number";             //房间号
    const Room_Field_GameRound          = "gameround";          //当前轮数
    const Room_Field_GameNum            = "gamenum";            //当前局数

    const Room_Field_Status             = "state";              //房间状态，1等待、2进行中、3关闭
    const Room_Field_Banker             = "banker";             //庄家 account_id
    const Room_Field_Scoreboard         = "scoreboard";         //每局积分榜
    const Room_Field_Creator            = "creator";            //房间创建者 account_id
    const Room_Field_StartTime          = "starttime";          //开局时间
    const Room_Field_Password           = "password";           //房间密码
    const Room_Field_TicketCount        = "ticketcount";        //消耗房卡数量

    const RoomRule_Key                  = self::Room_Key .":RoomRule";
    const RoomRule_Field_DefaultScore   = "defaultscore";       //开局默认分数
    const RoomRule_Field_ChipType       = "chiptype";           //筹码组  1   2
    const RoomRule_Field_DisablePkScore = "dispkscore";         //比牌最小分数0,100,500
    const RoomRule_Field_DisablePkMen   = "dispkmen";           //不能闷牌
    const RoomRule_Field_DisableLook    = "dislook";            //首轮不能看牌
    const RoomRule_Field_UpperLimit     = "upperlimit";         //封顶上限
    const RoomRule_Field_XiPai          = "xipaiscore";         //喜牌
    const RoomRule_Field_Onlybig        = "onlybig";            //只发大牌AKQJ10
    const RoomRule_Field_PlayerCount    = "playercount";        //最大玩家数
    const RoomRule_Field_TotalNum       = "totalnum";           //每轮总局数

    /**
     * Room Join Sequence 有序集合(不含观战者)
     * score   :   seatNumber 座号
     * value   :   account_id
     */
    const RoomSequence_Key              = self::Room_Key . ":RoomSequence";

    /** @var string 观战功能 房间观战者队列 */
    const RoomGuest_Key                 = self::Room_Key . ":RoomGuest";

    /** @var string Room Account User Status 用户状态 */
    const AccountStatus_Key             = self::Room_Key . ":AccountStatus";
    const AccountStatus_Field_User      = "[accountid]";

    /** @var string 游戏局玩家队列 */
    const PlayMember_Key                = self::Room_Key . ":PlayMember";

    /** @var string Room User Score总积分 */
    const RoomScore_Key                 = self::Room_Key . ":RoomScore";
    const RoomScore_Field_User          = "[accountid]";

    /** @var string 已经下注的筹码 */
    const Chip_Key                      = self::Room_Key . ":Chip";
    const Chip_Field_User               = "[accountid]";

    /** @var string 手牌 */
    const Card_Key                      = self::Room_Key . ":Card";
    const Card_Field_User               = "[accountid]";


    /** @var string 是否已经看牌  0尚未看牌   1已经看牌 */
    const SeenCard_Key                  = self::Room_Key . ":Seen";



    /** @var string 当前游戏局 */
    const Play_Key                      = self::Room_Key . ":Play";
    const Play_Field_PoolScore          = "poolscore";          //分数池
    const Play_Field_Benchmark          = "benchmark";          //当前叫分基准
    const Play_Field_ActiveUser         = "activeuser";         //当前操作用户，默认-1
    const Play_Field_TimerId            = "timerid";            //当前计时器ID，默认-1
    const Play_Field_TimerTime          = "timertime";          //自动开局计时器设置时间，默认-1表示没有倒计时

    const RoomPassword_Key              = "RoomPassword:[password]";       //房间密码
}
